package com.muyu.system.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author Administrator
 */

@Getter
@AllArgsConstructor
public enum OperatingTypeEnum {

    THIRD_PARTY(1, "三方",1),
    SELF_EMPLOYED(2, "自营",2),
    MIXED(3, "混合",3);

    @EnumValue
    @JsonValue
    private final int code;

    private final String name;

    private final Integer premium;

    @JsonCreator
    public static OperatingTypeEnum getOperatingTypeEnum(int code) {
        for (OperatingTypeEnum value : OperatingTypeEnum.values()) {
            if (value.code == code) {
                return value;
            }
        }
        return null;
    }
}
